<template>
    <!-- <el-config-provider> -->
    <el-config-provider :locale="i18nLocale">
        <router-view></router-view>
    </el-config-provider>
</template>

<script setup lang="ts" name="mainApp">
import { useLocaleStore } from "@/store";
import enElmentPlus from "element-plus/es/locale/lang/en";
import cnElmentPlus from "element-plus/es/locale/lang/zh-cn";

// console.log(`This is mainApp.vue`);

const localStore = useLocaleStore();

// const language = ref('zh-cn')

const i18nLocale = computed(() => {
    if (localStore.languageKey == "en") return enElmentPlus;
    else if (localStore.languageKey == "zh-cn") return cnElmentPlus;
    else return cnElmentPlus;
    // return getBrowserLang() == "zh" ? zhCn : en;
});
</script>
